﻿@{
    ViewBag.Title = "病例信息";
}

@model zqdn.Models.Case.CaseTpl

<style>
    dl {
        overflow: hidden;
    }

    dt, dd {
        float: left;
        color: black;
    }
</style>

<div class="pageheader">
    <h2><i class="fa fa-user"></i> 详细信息 </h2>
</div>

<div class="contentpanel">
    <div class="row">
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>日期：</dt>
                <dd>@Model.WriteTime.ToShortDateString()</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>住院号：</dt>
                <dd>@Model.ZyNo</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>科室：</dt>
                <dd>@Model.DepNo</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>床号：</dt>
                <dd>@Model.CNo</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>姓名：</dt>
                <dd>@Model.Name</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>性别：</dt>
                <dd>@Model.Sex</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>年龄：</dt>
                <dd>@Model.Age</dd>
            </dl>
        </div>
        <div class="col-md-4 col-sm-12">
            <dl>
                <dt>体重：</dt>
                <dd>@Model.Weight</dd>
            </dl>
        </div>
    </div>
    <div class="row">
       
        @if (Model.Type == 0)
        {
            <div class="col-sm-12">
                <div class="table-responsive">
                    <h2 style="color: #005ba8;font-weight: bold;">用药方案</h2>
                    <table class="table table-hidaction table-hover casetable">
                        <thead>
                            <tr>
                                <td>阶段</td>
                                <td>诱导期</td>
                                <td>维持期d</td>
                                <td>苏醒期</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>挥发罐刻度</td>
                                <td class="YDQ"></td>
                                <td class="WCQ"></td>
                                <td class="SXQ"></td>
                            </tr>
                            <tr>
                                <td>氧气流量</td>
                                <td class="YDQ"></td>
                                <td class="WCQ"></td>
                                <td class="SXQ"></td>
                            </tr>
                            <tr>
                                <td>应用时间</td>
                                <td class="YDQ"></td>
                                <td class="WCQ"></td>
                                <td class="SXQ"></td>
                            </tr>
                        </tbody>
                    </table>

                    <h2 style="color: #005ba8;font-weight: bold;">合并用药</h2>

                    <table class="table table-hidaction table-hover casetable">
                        <thead>
                            <tr>
                                <td>阶段</td>
                                <td>诱导期</td>
                                <td>维持期</td>
                                <td>苏醒期</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>药品名称</td>
                                <td class="MedCom_YDQ"></td>
                                <td class="MedCom_WCQ"></td>
                                <td class="MedCom_SXQ"></td>
                            </tr>
                            <tr>
                                <td>商品名</td>
                                <td class="MedCom_YDQ"></td>
                                <td class="MedCom_WCQ"></td>
                                <td class="MedCom_SXQ"></td>
                            </tr>
                            <tr>
                                <td>规格</td>
                                <td class="MedCom_YDQ"></td>
                                <td class="MedCom_WCQ"></td>
                                <td class="MedCom_SXQ"></td>
                            </tr>
                            <tr>
                                <td>数量</td>
                                <td class="MedCom_YDQ"></td>
                                <td class="MedCom_WCQ"></td>
                                <td class="MedCom_SXQ"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="col-sm-12">
                <dl>
                    <dt>完成医院：</dt>
                    <dd>@Model.ActiveHos</dd>
                </dl>
            </div>
            <div class="col-sm-12">
                <dl>
                    <dt>完成人：</dt>
                    <dd>@Model.ActiveID</dd>
                </dl>
            </div>
        }
        else if (Model.Type == 1)
        {
           <div class="col-sm-12">
            <div class="table-responsive">
                <h2 style="color: #005ba8;font-weight: bold;">药物配方</h2>
                <table class="table table-hidaction table-hover casetable">
                    <thead>
                        <tr>
                            <td>PCA配泵</td>
                            <td>布托啡诺</td>
                            <td>右美托咪啶</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>PCA背景输注</td>
                            <td class="MedCF_BTFN"></td>
                            <td class="MedCF_YMTMD"></td>
                        </tr>
                        <tr>
                            <td>单次剂量</td>
                            <td class="MedCF_BTFN"></td>
                            <td class="MedCF_YMTMD"></td>
                        </tr>
                        <tr>
                            <td>锁定时间</td>
                            <td class="MedCF_BTFN"></td>
                            <td class="MedCF_YMTMD"></td>
                        </tr>
                        <tr>
                            <td>术后镇痛总时长</td>
                            <td class="MedCF_BTFN"></td>
                            <td class="MedCF_YMTMD"></td>
                        </tr>
                    </tbody>
                </table>

                <h2 style="color: #005ba8;font-weight: bold;">其他配伍药物</h2>
                <table class="table table-hidaction table-hover casetable">
                    <thead>
                        <tr>
                            <td>药品名称</td>
                            <td>商品名</td>
                            <td>规格</td>
                            <td>数量</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="Med_PW_1"></td>
                            <td class="Med_PW_2"></td>
                            <td class="Med_PW_3"></td>
                            <td class="Med_PW_4"></td>
                        </tr>
                        <tr>
                            <td class="Med_PW_1"></td>
                            <td class="Med_PW_2"></td>
                            <td class="Med_PW_3"></td>
                            <td class="Med_PW_4"></td>
                        </tr>
                        <tr>
                            <td class="Med_PW_1"></td>
                            <td class="Med_PW_2"></td>
                            <td class="Med_PW_3"></td>
                            <td class="Med_PW_4"></td>
                        </tr>
                        <tr>
                            <td class="Med_PW_1"></td>
                            <td class="Med_PW_2"></td>
                            <td class="Med_PW_3"></td>
                            <td class="Med_PW_4"></td>
                        </tr>
                    </tbody>
                </table>
            </div>
           </div>
           <div class="col-sm-12">
               @Model.Med_GZ
           </div>
        }
        
        @{
            foreach (var item in Model.CaseImg.Split('$'))
            {
                if (!string.IsNullOrEmpty(item)) { 
                <div class="col-sm-12">
                    <img src="@item" style="max-width:500px;" alt="影像图片" />
                </div>
                }
            }
        }

    </div>
</div>

<script>
    function RenderDom(dom, arr) {
        var i = 0;
        var k = dom.length;

        for (; i < k; i++) {
            dom.eq(i).html(arr[i]);
        }
    }
</script>

    @if (Model.Type == 0) {
        <script>
            $(function () {
                //用药方案
                var YDQ = "@Model.Med_YDQ";
                var WCQ = "@Model.Med_WCQ";
                var SXQ = "@Model.Med_SXQ";

                var YDQ_Arr = (YDQ == "" ? ["&nbsp;", "&nbsp;", "&nbsp;"] : YDQ.replace(/&amp;/g, "&").split("&"));
                var WCQ_Arr = (WCQ == "" ? ["&nbsp;", "&nbsp;", "&nbsp;"] : WCQ.replace(/&amp;/g, "&").split("&"));
                var SXQ_Arr = (SXQ == "" ? ["&nbsp;", "&nbsp;", "&nbsp;"] : SXQ.replace(/&amp;/g, "&").split("&"));

                var YDQ_DOM = $(".YDQ");
                var WCQ_DOM = $(".WCQ");
                var SXQ_DOM = $(".SXQ");

                RenderDom(YDQ_DOM, YDQ_Arr);
                RenderDom(WCQ_DOM, WCQ_Arr);
                RenderDom(SXQ_DOM, SXQ_Arr);

                //合并用药
                var MedCom_YDQ = "@Model.MedCom_YDQ";
                var MedCom_WCQ = "@Model.MedCom_WCQ";
                var MedCom_SXQ = "@Model.MedCom_SXQ";

                var MedCom_YDQ_Arr = (MedCom_YDQ == "" ? ["&nbsp;", "&nbsp;", "&nbsp;"] : MedCom_YDQ.replace(/&amp;/g, "&").split("&"));
                var MedCom_WCQ_Arr = (MedCom_WCQ == "" ? ["&nbsp;", "&nbsp;", "&nbsp;"] : MedCom_WCQ.replace(/&amp;/g, "&").split("&"));
                var MedCom_SXQ_Arr = (MedCom_SXQ == "" ? ["&nbsp;", "&nbsp;", "&nbsp;"] : MedCom_SXQ.replace(/&amp;/g, "&").split("&"));

                var MedCom_YDQ_DOM = $(".MedCom_YDQ");
                var MedCom_WCQ_DOM = $(".MedCom_WCQ");
                var MedCom_SXQ_DOM = $(".MedCom_SXQ");

                RenderDom(MedCom_YDQ_DOM, MedCom_YDQ_Arr);
                RenderDom(MedCom_WCQ_DOM, MedCom_WCQ_Arr);
                RenderDom(MedCom_SXQ_Arr, MedCom_SXQ_Arr);
            });
        </script>
    }
    else if (Model.Type == 1)
    {
        <script>
            $(function () {
                //药物配方
                var MedCF_BTFN = "@Model.MedCf_BTFN";
                var MedCF_YMTMD = "@Model.MedCf_YMTMD";

                var MedCF_BTFN_Arr = (MedCF_BTFN == "" ? ["&nbsp;", "&nbsp;"] : MedCF_BTFN.replace(/&amp;/g, "&").split("&"));
                var MedCF_YMTMD_Arr = (MedCF_YMTMD == "" ? ["&nbsp;", "&nbsp;"] : MedCF_YMTMD.replace(/&amp;/g, "&").split("&"));

                var MedCF_BTFN_DOM = $(".MedCF_BTFN");
                var MedCF_YMTMD_DOM = $(".MedCF_YMTMD");
                RenderDom(MedCF_BTFN_DOM, MedCF_BTFN_Arr);
                RenderDom(MedCF_YMTMD_DOM, MedCF_YMTMD_Arr);

                //其他配伍药物
                var Med_PW_1 = "@Model.Med_PW_1";
                var Med_PW_2 = "@Model.Med_PW_2";
                var Med_PW_3 = "@Model.Med_PW_3";
                var Med_PW_4 = "@Model.Med_PW_4";

                var Med_PW_1_Arr = (Med_PW_1 == "" ? ["&nbsp;", "&nbsp;", "&nbsp;", "&nbsp;"] : Med_PW_1.replace(/&amp;/g, "&").split("&"));
                var Med_PW_2_Arr = (Med_PW_2 == "" ? ["&nbsp;", "&nbsp;", "&nbsp;", "&nbsp;"] : Med_PW_2.replace(/&amp;/g, "&").split("&"));
                var Med_PW_3_Arr = (Med_PW_3 == "" ? ["&nbsp;", "&nbsp;", "&nbsp;", "&nbsp;"] : Med_PW_3.replace(/&amp;/g, "&").split("&"));
                var Med_PW_4_Arr = (Med_PW_4 == "" ? ["&nbsp;", "&nbsp;", "&nbsp;", "&nbsp;"] : Med_PW_4.replace(/&amp;/g, "&").split("&"));

                var Med_PW_1_DOM = $(".Med_PW_1");
                var Med_PW_2_DOM = $(".Med_PW_2");
                var Med_PW_3_DOM = $(".Med_PW_3");
                var Med_PW_4_DOM = $(".Med_PW_4");

                RenderDom(Med_PW_1_DOM, Med_PW_1_Arr);
                RenderDom(Med_PW_2_DOM, Med_PW_2_Arr);
                RenderDom(Med_PW_3_DOM, Med_PW_3_Arr);
                RenderDom(Med_PW_4_DOM, Med_PW_4_Arr);
            });
        </script>
    }




